package com;

import com.utils.DateUtil;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;

import javax.servlet.MultipartConfigElement;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

@EnableScheduling
@EnableAutoConfiguration(exclude = {SecurityAutoConfiguration.class})
@MapperScan("com.dao")
@ComponentScan(basePackages = {"com.*"})
public class AutoVenderMain {



    @Bean
    public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        //文件最大
        factory.setMaxFileSize("200MB"); //KB,MB
        /// 设置总上传数据总大小
        factory.setMaxRequestSize("2000MB");
        return factory.createMultipartConfig();
    }



    public static void main(String[] args) throws Exception {
        SpringApplication.run(AutoVenderMain.class, args);
        System.out.println(".................智能陪护床服务端微服务启动完成...............");
        List<Integer> source =null;// Arrays.asList(1, 2, 3);
        List<Integer> collect =null;//  source.stream().skip(1).collect(Collectors.toList());
        List<Integer> flowers = Optional.ofNullable(collect)
                .map(List::stream)
                .orElseGet(Stream::empty)
                .collect(Collectors.toList());
        System.out.println(flowers);
    }




}
